package design.patterns.factorymode.factoryabstract;

/**
 * @Desc:   抽象工厂测试主类
 * @author: cww
 * @DateTime: 2020-06-08 15:23
 */

public class MainFactoryAbstract {

    public static void main(String[] args) {
        TropicalGardener tropicalGarden = new TropicalGardener();
        TropicalFruit f1 = (TropicalFruit) tropicalGarden.createTropicalFruit();
        System.out.println(f1.getName());
        TropicalVeggie f2 = (TropicalVeggie) tropicalGarden.createTropicalVeggie();
        System.out.println(f2.getName());

        NorthernGardener northernGardener = new NorthernGardener();
        NorthernFruit fruit = (NorthernFruit) northernGardener.createNorthenFruit();
        NorthernVaggie vaggie = (NorthernVaggie) northernGardener.createNorthenVaggie();
        System.out.println(fruit.getName());
        System.out.println(vaggie.getName());

    }
}
